package com.qfjg.myutil;

import lombok.Data;

//统一响应
@Data
public class ResultData<T> {
    private int status;
    private String message;
    private T data;
    private String timestamp;


    public ResultData(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
        this.timestamp = DateUtil.formatTimestamp();
    }


    public ResultData(T data) {
        this.status = 200;
        this.message = "成功";
        this.data = data;
        this.timestamp = DateUtil.formatTimestamp();
    }



    public static ResultData<String> SUCCESS() {
        return new ResultData<>(null);
    }


}